import sys
import os
from PyQt5.QtWidgets import QApplication, QMainWindow

# 初始化环境
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(SCRIPT_DIR)


from ui.centralwidget import CentralWidget
from config.config_mgr import get_config_manager

class Window(QMainWindow):
    def __init__(self):
        super().__init__()
        self._init_widget()

    def _init_widget(self):
        """初始化界面"""
        self.setWindowTitle('lineprofiler-ui')
        self.setGeometry(300, 100, 1400, 800)
        self.setCentralWidget(CentralWidget())
        self.show()

if __name__ == '__main__':
    get_config_manager().load()
    app = QApplication(sys.argv)
    w = Window()
    sys.exit(app.exec_())